/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package first;

import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.layout.Region;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;

/**
 *
 * @author Customer
 */
public class Browser extends Region {

    WebView browser = new WebView();
    WebEngine webEngine = browser.getEngine();

    public Browser() {
        //apply the styles
        //getStyleClass().add("browser");
        // load the web page
        webEngine.load(getClass().getResource("/Html_Javascript/Googlemap.html").toString());
        //add the web view to the scene
        getChildren().add(browser);

    }

    @Override
    protected void layoutChildren() {
        double w = getWidth();
        double h = getHeight();
        layoutInArea(browser, 0, 0, w, h, 0, HPos.CENTER, VPos.CENTER);
    }

    @Override
    protected double computePrefWidth(double height) {
        return 800;
    }

    @Override
    protected double computePrefHeight(double width) {
        return 700;
    }
}